package ${package_feign};
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import ${package_pojo}.${Table};

@FeignClient(name="${serviceName}",contextId = "${table}",fallback=${Table}Fallback.class)
public interface ${Table}Feign {

    /***
     * 分页条件搜索实现${Table}
     * @param ${table}
     * @param page
     * @param size
     * @return
     */
    @PostMapping(value = "/${table}/search/{page}/{size}")
    Result<Page> findPage(@RequestBody(required = false) ${Table} ${table},@PathVariable(value="page") int page,@PathVariable(value="size") int size);

    /***
     * 分页搜索实现${Table}
     * @param page:当前页
     * @param size:每页显示多少条
     * @return
     */
    @GetMapping(value = "/${table}/search/{page}/{size}")
    Result<Page> findPage(@PathVariable(value="page") int page,@PathVariable(value="size") int size);

    /***
     * 多条件搜索${Table}数据
     * @param ${table}
     * @return
     */
    @PostMapping(value = "/${table}/search")
    Result<List<${Table}>>findList(@RequestBody(required = false) ${Table} ${table});

    /***
     * 根据Id删除${table}数据
     * @param id
     * @return
     */
    @DeleteMapping(value = "/${table}/{id}")
    Result delete(@PathVariable(value="id") ${keyType} id);

    /***
     * 根据ID修改${Table}数据
     * @param ${table}
     * @return
     */
    @PutMapping(value = "/${table}")
    Result updateById(@RequestBody ${Table} ${table});

    /***
     * 新增${Table}数据
     * @param ${table}
     * @return
     */
    @PostMapping(value = "/${table}")
    Result add(@RequestBody ${Table} ${table});

    /***
     * 根据ID查询${Table}数据
     * @param id
     * @return
     */
    @GetMapping("/${table}/{id}")
    Result<${Table}>findById(@PathVariable(value="id") ${keyType} id);

    /***
     * 查询${Table}全部数据
     * @return
     */
    @GetMapping(value = "/${table}")
    Result<List<${Table}>>findAll();

}
